package com.qingke.memo;

import java.io.InputStream;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class MemoDao {
	
	public MemoDao(){
		
	}
	
	public static SqlSession mybatisSession(){
		String resource = "mybatis_conf.xml";
		InputStream is=null;
		is=MemoApp.class.getClassLoader().getResourceAsStream(resource);
		SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(is);
		SqlSession session = sessionFactory.openSession();
		return session;
	}
	
	
}
